/*
 * Copyright (c) United Binary LLC.  All rights reserved.
 * 
 * This code is licensed under the MIT License
 * 
 * SEE: http://harnessit.codeplex.com/license
 * 
 */
using System;
using UnitedBinary.HarnessIt.SharedTypes;
using UnitedBinary.UnitTests.Framework;
using System.Runtime.InteropServices;
using UnitedBinary.HarnessIt.UnitTests.Settings;

namespace UnitedBinary.HarnessIt.UnitTests.SharedTypes
{
	/// <summary>
	///		Testing the assemblies requires loading actual assemblies
	///		from the disk. For that reason this class is a little lighter
	///		on the tests than the ClassTests and MethodTests classes.
	/// </summary>
	public class AssemblyTests
	{
		public AssemblyTests()
		{
		}

		[TestMethod("Test the initial values of our Assembly class.")]
		public void ConstructionTests_InitialValues(TestMethodRecord tmr)
		{
			Assembly A = new Assembly(UnitTestSettings.BaselineAssemblyPath);

			tmr.RunTest(A.Active == true, "Assembly is active.");
			tmr.RunTest(A.Version == "1.5.0.1", "Assembly version is correct.");
			tmr.RunTest(A.ClassCount == 0, "No classes in an empty assembly.");
			tmr.RunTest(A.Classes.Length == 0, "No classes in an empty assembly (2).");
			tmr.RunTest(A.ContainsActiveTests == false, "No active tests.");
			tmr.RunTest(A.ContainsTests == false, "No tests.");
			tmr.RunTest(A.Description == "", "No description in assembly.");
			tmr.RunTest(A.TestRecord.HasRun == false, "Has not run tests.");
			tmr.RunTest(A.OrderMode == TestOrderModes.Neutral, "Neutral order mode.");
			tmr.RunTest(A.SubModeOrder == 100, "SubModeOrder is 100.");
		}

//		[DllImport("mscoree.dll")]
//		private static extern int GetCORSystemDirectory(
//			//[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder buffer,
//			string buf,
//			int bufferLength,
//			int length);
//
	}
}
